﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Ashwani.Cryptography.Hashing
{
    public interface IHashProvider
    {
        /// <summary>
        /// Create the hash and randomly generates the salt. The salt value is appened to the final hash.
        /// </summary>
        /// <param name="plaintext"></param>
        /// <returns>Hashed bytes</returns>
        byte[] ComputeHash(byte[] plaintext);
        
        /// <summary>
        /// compares the plaintext and hashedtext and retruns true if matched.
        /// </summary>
        /// <param name="plaintext"></param>
        /// <param name="hashedtext"></param>
        /// <returns>true if matched.</returns>
        bool CompareHash(byte[] plaintext, byte[] hashedtext);
    }
}
